<?php
/**
 * Convenience arrays and access methods for the full IANA Language Subtag Registry
 * 
 * Extracted from http://www.iana.org/assignments/language-subtag-registry
 * File date: 2009-01-13
 * 
 * Check the following URL for a great explanation of these tags:
 * http://www.w3.org/International/articles/language-tags/
 * 
 * Copyright (c) 2009 Guillermo Señas
 * 
 * http://ianacatalog.googlecode.com/
 * 
 * Permission is hereby granted, free of charge, to any
 * person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the
 * Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the
 * Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice
 * shall be included in all copies or substantial portions of
 * the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
 * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
 * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * 
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 * 
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 * @version 	  1.0
 */

class IANACatalog {
	
	/**
	 * Full IANA Catalog, grouped by subtag type.
	 *
	 * @var array
	 * @access private
	 **/
	public static $fullCatalog = array(
		"language"=> array (
			"aa" => "Afar",
			"ab" => "Abkhazian", /* Suppress-Script - Cyrl */
			"ace" => "Achinese",
			"ach" => "Acoli",
			"ada" => "Adangme",
			"ady" => "Adyghe, Adygei",
			"ae" => "Avestan",
			"af" => "Afrikaans", /* Suppress-Script - Latn */
			"afa" => "Afro-Asiatic (Other)",
			"afh" => "Afrihili",
			"ain" => "Ainu",
			"ak" => "Akan",
			"akk" => "Akkadian",
			"ale" => "Aleut",
			"alg" => "Algonquian languages",
			"alt" => "Southern Altai",
			"am" => "Amharic", /* Suppress-Script - Ethi */
			"an" => "Aragonese",
			"ang" => "English, Old (ca. 450-1100)",
			"anp" => "Angika",
			"apa" => "Apache languages",
			"ar" => "Arabic", /* Suppress-Script - Arab */
			"arc" => "Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE)",
			"arn" => "Mapudungun, Mapuche",
			"arp" => "Arapaho",
			"art" => "Artificial (Other)",
			"arw" => "Arawak",
			"as" => "Assamese", /* Suppress-Script - Beng */
			"ast" => "Asturian, Bable, Leonese, Asturleonese",
			"ath" => "Athapascan languages",
			"aus" => "Australian languages",
			"av" => "Avaric",
			"awa" => "Awadhi",
			"ay" => "Aymara", /* Suppress-Script - Latn */
			"az" => "Azerbaijani",
			"ba" => "Bashkir",
			"bad" => "Banda languages",
			"bai" => "Bamileke languages",
			"bal" => "Baluchi",
			"ban" => "Balinese",
			"bas" => "Basa",
			"bat" => "Baltic (Other)",
			"be" => "Belarusian", /* Suppress-Script - Cyrl */
			"bej" => "Beja, Bedawiyet",
			"bem" => "Bemba",
			"ber" => "Berber (Other)",
			"bg" => "Bulgarian", /* Suppress-Script - Cyrl */
			"bh" => "Bihari",
			"bho" => "Bhojpuri",
			"bi" => "Bislama",
			"bik" => "Bikol",
			"bin" => "Bini, Edo",
			"bla" => "Siksika",
			"bm" => "Bambara",
			"bn" => "Bengali", /* Suppress-Script - Beng */
			"bnt" => "Bantu (Other)",
			"bo" => "Tibetan",
			"br" => "Breton",
			"bra" => "Braj",
			"bs" => "Bosnian", /* Suppress-Script - Latn */
			"btk" => "Batak languages",
			"bua" => "Buriat",
			"bug" => "Buginese",
			"byn" => "Blin, Bilin",
			"ca" => "Catalan, Valencian", /* Suppress-Script - Latn */
			"cad" => "Caddo",
			"cai" => "Central American Indian (Other)",
			"car" => "Galibi Carib",
			"cau" => "Caucasian (Other)",
			"ce" => "Chechen",
			"ceb" => "Cebuano",
			"cel" => "Celtic (Other)",
			"ch" => "Chamorro", /* Suppress-Script - Latn */
			"chb" => "Chibcha",
			"chg" => "Chagatai",
			"chk" => "Chuukese",
			"chm" => "Mari",
			"chn" => "Chinook jargon",
			"cho" => "Choctaw",
			"chp" => "Chipewyan, Dene Suline",
			"chr" => "Cherokee",
			"chy" => "Cheyenne",
			"cmc" => "Chamic languages",
			"co" => "Corsican",
			"cop" => "Coptic",
			"cpe" => "Creoles and pidgins, English-based (Other)",
			"cpf" => "Creoles and pidgins, French-based (Other)",
			"cpp" => "Creoles and pidgins, Portuguese-based (Other)",
			"cr" => "Cree",
			"crh" => "Crimean Tatar, Crimean Turkish",
			"crp" => "Creoles and pidgins (Other)",
			"cs" => "Czech", /* Suppress-Script - Latn */
			"csb" => "Kashubian",
			"cu" => "Church Slavic, Old Slavonic, Church Slavonic, Old Bulgarian, Old Church Slavonic",
			"cus" => "Cushitic (Other)",
			"cv" => "Chuvash",
			"cy" => "Welsh", /* Suppress-Script - Latn */
			"da" => "Danish", /* Suppress-Script - Latn */
			"dak" => "Dakota",
			"dar" => "Dargwa",
			"day" => "Land Dayak languages",
			"de" => "German", /* Suppress-Script - Latn */
			"del" => "Delaware",
			"den" => "Slave (Athapascan)",
			"dgr" => "Dogrib",
			"din" => "Dinka",
			"doi" => "Dogri",
			"dra" => "Dravidian (Other)",
			"dsb" => "Lower Sorbian", /* Suppress-Script - Latn */
			"dua" => "Duala",
			"dum" => "Dutch, Middle (ca. 1050-1350)",
			"dv" => "Divehi, Dhivehi, Maldivian", /* Suppress-Script - Thaa */
			"dyu" => "Dyula",
			"dz" => "Dzongkha", /* Suppress-Script - Tibt */
			"ee" => "Ewe",
			"efi" => "Efik",
			"egy" => "Egyptian (Ancient)",
			"eka" => "Ekajuk",
			"el" => "Greek, Modern (1453-)", /* Suppress-Script - Grek */
			"elx" => "Elamite",
			"en" => "English", /* Suppress-Script - Latn */
			"enm" => "English, Middle (1100-1500)",
			"eo" => "Esperanto", /* Suppress-Script - Latn */
			"es" => "Spanish, Castilian", /* Suppress-Script - Latn */
			"et" => "Estonian", /* Suppress-Script - Latn */
			"eu" => "Basque", /* Suppress-Script - Latn */
			"ewo" => "Ewondo",
			"fa" => "Persian", /* Suppress-Script - Arab */
			"fan" => "Fang",
			"fat" => "Fanti",
			"ff" => "Fulah",
			"fi" => "Finnish", /* Suppress-Script - Latn */
			"fil" => "Filipino, Pilipino",
			"fiu" => "Finno-Ugrian (Other)",
			"fj" => "Fijian", /* Suppress-Script - Latn */
			"fo" => "Faroese", /* Suppress-Script - Latn */
			"fon" => "Fon",
			"fr" => "French", /* Suppress-Script - Latn */
			"frm" => "French, Middle (ca. 1400-1600)",
			"fro" => "French, Old (842-ca. 1400)",
			"frr" => "Northern Frisian", /* Suppress-Script - Latn */
			"frs" => "Eastern Frisian", /* Suppress-Script - Latn */
			"fur" => "Friulian",
			"fy" => "Western Frisian", /* Suppress-Script - Latn */
			"ga" => "Irish", /* Suppress-Script - Latn */
			"gaa" => "Ga",
			"gay" => "Gayo",
			"gba" => "Gbaya",
			"gd" => "Gaelic, Scottish Gaelic",
			"gem" => "Germanic (Other)",
			"gez" => "Geez",
			"gil" => "Gilbertese",
			"gl" => "Galician", /* Suppress-Script - Latn */
			"gmh" => "German, Middle High (ca. 1050-1500)",
			"gn" => "Guarani", /* Suppress-Script - Latn */
			"goh" => "German, Old High (ca. 750-1050)",
			"gon" => "Gondi",
			"gor" => "Gorontalo",
			"got" => "Gothic",
			"grb" => "Grebo",
			"grc" => "Greek, Ancient (to 1453)",
			"gsw" => "Swiss German, Alemannic, Alsatian", /* Suppress-Script - Latn */
			"gu" => "Gujarati", /* Suppress-Script - Gujr */
			"gv" => "Manx", /* Suppress-Script - Latn */
			"gwi" => "Gwich´in",
			"ha" => "Hausa",
			"hai" => "Haida",
			"haw" => "Hawaiian",
			"he" => "Hebrew", /* Suppress-Script - Hebr */
			"hi" => "Hindi", /* Suppress-Script - Deva */
			"hil" => "Hiligaynon",
			"him" => "Himachali",
			"hit" => "Hittite",
			"hmn" => "Hmong",
			"ho" => "Hiri Motu",
			"hr" => "Croatian", /* Suppress-Script - Latn */
			"hsb" => "Upper Sorbian", /* Suppress-Script - Latn */
			"ht" => "Haitian, Haitian Creole", /* Suppress-Script - Latn */
			"hu" => "Hungarian", /* Suppress-Script - Latn */
			"hup" => "Hupa",
			"hy" => "Armenian", /* Suppress-Script - Armn */
			"hz" => "Herero",
			"ia" => "Interlingua (International Auxiliary Language",
			"iba" => "Iban",
			"id" => "Indonesian", /* Suppress-Script - Latn */
			"ie" => "Interlingue, Occidental",
			"ig" => "Igbo",
			"ii" => "Sichuan Yi, Nuosu",
			"ijo" => "Ijo languages",
			"ik" => "Inupiaq",
			"ilo" => "Iloko",
			"in" => "Indonesian [Do not use!]", /* Preferred-Value - id Deprecated - 1989-01-01 Suppress-Script - Latn */
			"inc" => "Indic (Other)",
			"ine" => "Indo-European (Other)",
			"inh" => "Ingush",
			"io" => "Ido",
			"ira" => "Iranian (Other)",
			"iro" => "Iroquoian languages",
			"is" => "Icelandic", /* Suppress-Script - Latn */
			"it" => "Italian", /* Suppress-Script - Latn */
			"iu" => "Inuktitut",
			"iw" => "Hebrew [Do not use!]", /* Preferred-Value - he Deprecated - 1989-01-01 Suppress-Script - Hebr */
			"ja" => "Japanese", /* Suppress-Script - Jpan */
			"jbo" => "Lojban",
			"ji" => "Yiddish [Do not use!]", /* Preferred-Value - yi Deprecated - 1989-01-01 */
			"jpr" => "Judeo-Persian",
			"jrb" => "Judeo-Arabic",
			"jv" => "Javanese",
			"jw" => "Javanese [Do not use!]", /* Preferred-Value - jv Deprecated - 2001-08-13 Comments - published by error in Table 1 of ISO 639 */
			"ka" => "Georgian", /* Suppress-Script - Geor */
			"kaa" => "Kara-Kalpak",
			"kab" => "Kabyle",
			"kac" => "Kachin, Jingpho",
			"kam" => "Kamba",
			"kar" => "Karen languages",
			"kaw" => "Kawi",
			"kbd" => "Kabardian",
			"kg" => "Kongo",
			"kha" => "Khasi",
			"khi" => "Khoisan (Other)",
			"kho" => "Khotanese",
			"ki" => "Kikuyu, Gikuyu",
			"kj" => "Kuanyama, Kwanyama",
			"kk" => "Kazakh", /* Suppress-Script - Cyrl */
			"kl" => "Kalaallisut, Greenlandic", /* Suppress-Script - Latn */
			"km" => "Central Khmer", /* Suppress-Script - Khmr */
			"kmb" => "Kimbundu",
			"kn" => "Kannada", /* Suppress-Script - Knda */
			"ko" => "Korean", /* Suppress-Script - Kore */
			"kok" => "Konkani", /* Suppress-Script - Deva */
			"kos" => "Kosraean",
			"kpe" => "Kpelle",
			"kr" => "Kanuri",
			"krc" => "Karachay-Balkar",
			"krl" => "Karelian",
			"kro" => "Kru languages",
			"kru" => "Kurukh",
			"ks" => "Kashmiri",
			"ku" => "Kurdish",
			"kum" => "Kumyk",
			"kut" => "Kutenai",
			"kv" => "Komi",
			"kw" => "Cornish",
			"ky" => "Kyrgyz, Kirghiz",
			"la" => "Latin", /* Suppress-Script - Latn */
			"lad" => "Ladino",
			"lah" => "Lahnda",
			"lam" => "Lamba",
			"lb" => "Luxembourgish, Letzeburgesch", /* Suppress-Script - Latn */
			"lez" => "Lezghian",
			"lg" => "Ganda",
			"li" => "Limburgan, Limburger, Limburgish",
			"ln" => "Lingala", /* Suppress-Script - Latn */
			"lo" => "Lao", /* Suppress-Script - Laoo */
			"lol" => "Mongo",
			"loz" => "Lozi",
			"lt" => "Lithuanian", /* Suppress-Script - Latn */
			"lu" => "Luba-Katanga",
			"lua" => "Luba-Lulua",
			"lui" => "Luiseno",
			"lun" => "Lunda",
			"luo" => "Luo (Kenya and Tanzania)",
			"lus" => "Lushai",
			"lv" => "Latvian", /* Suppress-Script - Latn */
			"mad" => "Madurese",
			"mag" => "Magahi",
			"mai" => "Maithili", /* Suppress-Script - Deva */
			"mak" => "Makasar",
			"man" => "Mandingo",
			"map" => "Austronesian (Other)",
			"mas" => "Masai",
			"mdf" => "Moksha",
			"mdr" => "Mandar",
			"men" => "Mende", /* Suppress-Script - Latn */
			"mg" => "Malagasy", /* Suppress-Script - Latn */
			"mga" => "Irish, Middle (900-1200)",
			"mh" => "Marshallese", /* Suppress-Script - Latn */
			"mi" => "Maori",
			"mic" => "Mi'kmaq, Micmac",
			"min" => "Minangkabau",
			"mis" => "Uncoded languages",
			"mk" => "Macedonian", /* Suppress-Script - Cyrl */
			"mkh" => "Mon-Khmer (Other)",
			"ml" => "Malayalam", /* Suppress-Script - Mlym */
			"mn" => "Mongolian",
			"mnc" => "Manchu",
			"mni" => "Manipuri",
			"mno" => "Manobo languages",
			"mo" => "Moldavian, Moldovan [Do not use!]", /* Deprecated - 2008-11-22 Preferred-Value - ro Suppress-Script - Latn */
			"moh" => "Mohawk",
			"mos" => "Mossi",
			"mr" => "Marathi", /* Suppress-Script - Deva */
			"ms" => "Malay", /* Suppress-Script - Latn */
			"mt" => "Maltese", /* Suppress-Script - Latn */
			"mul" => "Multiple languages",
			"mun" => "Munda languages",
			"mus" => "Creek",
			"mwl" => "Mirandese",
			"mwr" => "Marwari",
			"my" => "Burmese", /* Suppress-Script - Mymr */
			"myn" => "Mayan languages",
			"myv" => "Erzya",
			"na" => "Nauru", /* Suppress-Script - Latn */
			"nah" => "Nahuatl languages",
			"nai" => "North American Indian",
			"nap" => "Neapolitan",
			"nb" => "Norwegian Bokmål", /* Suppress-Script - Latn */
			"nd" => "Ndebele, North, North Ndebele", /* Suppress-Script - Latn */
			"nds" => "Low German, Low Saxon, German, Low, Saxon, Low", /* Suppress-Script - Latn */
			"ne" => "Nepali", /* Suppress-Script - Deva */
			"new" => "Nepal Bhasa, Newari",
			"ng" => "Ndonga",
			"nia" => "Nias",
			"nic" => "Niger-Kordofanian (Other)",
			"niu" => "Niuean", /* Suppress-Script - Latn */
			"nl" => "Dutch, Flemish", /* Suppress-Script - Latn */
			"nn" => "Norwegian Nynorsk", /* Suppress-Script - Latn */
			"no" => "Norwegian", /* Suppress-Script - Latn */
			"nog" => "Nogai",
			"non" => "Norse, Old",
			"nqo" => "N’Ko", /* Suppress-Script - Nkoo */
			"nr" => "Ndebele, South, South Ndebele", /* Suppress-Script - Latn */
			"nso" => "Northern Sotho, Pedi, Sepedi", /* Suppress-Script - Latn */
			"nub" => "Nubian languages",
			"nv" => "Navajo, Navaho",
			"nwc" => "Classical Newari, Old Newari, Classical Nepal Bhasa",
			"ny" => "Chichewa, Chewa, Nyanja", /* Suppress-Script - Latn */
			"nym" => "Nyamwezi",
			"nyn" => "Nyankole",
			"nyo" => "Nyoro",
			"nzi" => "Nzima",
			"oc" => "Occitan (post 1500)",
			"oj" => "Ojibwa",
			"om" => "Oromo", /* Suppress-Script - Latn */
			"or" => "Oriya", /* Suppress-Script - Orya */
			"os" => "Ossetian, Ossetic",
			"osa" => "Osage",
			"ota" => "Turkish, Ottoman (1500-1928)",
			"oto" => "Otomian languages",
			"pa" => "Panjabi, Punjabi", /* Suppress-Script - Guru */
			"paa" => "Papuan (Other)",
			"pag" => "Pangasinan",
			"pal" => "Pahlavi",
			"pam" => "Pampanga, Kapampangan",
			"pap" => "Papiamento",
			"pau" => "Palauan",
			"peo" => "Persian, Old (ca. 600-400 B.C.)",
			"phi" => "Philippine (Other)",
			"phn" => "Phoenician",
			"pi" => "Pali",
			"pl" => "Polish", /* Suppress-Script - Latn */
			"pon" => "Pohnpeian",
			"pra" => "Prakrit languages",
			"pro" => "Provençal, Old (to 1500), Old Occitan (to 1500)",
			"ps" => "Pushto, Pashto", /* Suppress-Script - Arab */
			"pt" => "Portuguese", /* Suppress-Script - Latn */
			/**
			 * "qaa" to "qaz" are reserved for PRIVATE USE
			*/
			"qu" => "Quechua", /* Suppress-Script - Latn */
			"raj" => "Rajasthani",
			"rap" => "Rapanui",
			"rar" => "Rarotongan, Cook Islands Maori",
			"rm" => "Romansh",
			"rn" => "Rundi", /* Suppress-Script - Latn */
			"ro" => "Romanian, Moldavian, Moldovan", /* Suppress-Script - Latn */
			"roa" => "Romance (Other)",
			"rom" => "Romany",
			"ru" => "Russian", /* Suppress-Script - Cyrl */
			"rup" => "Aromanian, Arumanian, Macedo-Romanian",
			"rw" => "Kinyarwanda", /* Suppress-Script - Latn */
			"sa" => "Sanskrit",
			"sad" => "Sandawe",
			"sah" => "Yakut",
			"sai" => "South American Indian (Other)",
			"sal" => "Salishan languages",
			"sam" => "Samaritan Aramaic",
			"sas" => "Sasak",
			"sat" => "Santali",
			"sc" => "Sardinian",
			"scn" => "Sicilian",
			"sco" => "Scots",
			"sd" => "Sindhi",
			"se" => "Northern Sami",
			"sel" => "Selkup",
			"sem" => "Semitic (Other)",
			"sg" => "Sango", /* Suppress-Script - Latn */
			"sga" => "Irish, Old (to 900)",
			"sgn" => "Sign Languages",
			"sh" => "Serbo-Croatian [Do not use!]", /* Deprecated - 2000-02-18 */
			"shn" => "Shan",
			"si" => "Sinhala, Sinhalese", /* Suppress-Script - Sinh */
			"sid" => "Sidamo",
			"sio" => "Siouan languages",
			"sit" => "Sino-Tibetan (Other)",
			"sk" => "Slovak", /* Suppress-Script - Latn */
			"sl" => "Slovenian", /* Suppress-Script - Latn */
			"sla" => "Slavic (Other)",
			"sm" => "Samoan", /* Suppress-Script - Latn */
			"sma" => "Southern Sami",
			"smi" => "Sami languages (Other)",
			"smj" => "Lule Sami",
			"smn" => "Inari Sami",
			"sms" => "Skolt Sami",
			"sn" => "Shona",
			"snk" => "Soninke",
			"so" => "Somali", /* Suppress-Script - Latn */
			"sog" => "Sogdian",
			"son" => "Songhai languages",
			"sq" => "Albanian", /* Suppress-Script - Latn */
			"sr" => "Serbian",
			"srn" => "Sranan Tongo",
			"srr" => "Serer",
			"ss" => "Swati", /* Suppress-Script - Latn */
			"ssa" => "Nilo-Saharan (Other)",
			"st" => "Sotho, Southern", /* Suppress-Script - Latn */
			"su" => "Sundanese",
			"suk" => "Sukuma",
			"sus" => "Susu",
			"sux" => "Sumerian",
			"sv" => "Swedish", /* Suppress-Script - Latn */
			"sw" => "Swahili", /* Suppress-Script - Latn */
			"syc" => "Classical Syriac",
			"syr" => "Syriac",
			"ta" => "Tamil", /* Suppress-Script - Taml */
			"tai" => "Tai (Other)",
			"te" => "Telugu", /* Suppress-Script - Telu */
			"tem" => "Timne", /* Suppress-Script - Latn */
			"ter" => "Tereno",
			"tet" => "Tetum",
			"tg" => "Tajik",
			"th" => "Thai", /* Suppress-Script - Thai */
			"ti" => "Tigrinya", /* Suppress-Script - Ethi */
			"tig" => "Tigre",
			"tiv" => "Tiv",
			"tk" => "Turkmen",
			"tkl" => "Tokelau", /* Suppress-Script - Latn */
			"tl" => "Tagalog", /* Suppress-Script - Latn */
			"tlh" => "Klingon, tlhIngan-Hol",
			"tli" => "Tlingit",
			"tmh" => "Tamashek", /* Suppress-Script - Latn */
			"tn" => "Tswana", /* Suppress-Script - Latn */
			"to" => "Tonga (Tonga Islands)", /* Suppress-Script - Latn */
			"tog" => "Tonga (Nyasa)",
			"tpi" => "Tok Pisin", /* Suppress-Script - Latn */
			"tr" => "Turkish", /* Suppress-Script - Latn */
			"ts" => "Tsonga", /* Suppress-Script - Latn */
			"tsi" => "Tsimshian",
			"tt" => "Tatar",
			"tum" => "Tumbuka",
			"tup" => "Tupi languages",
			"tut" => "Altaic (Other)",
			"tvl" => "Tuvalu", /* Suppress-Script - Latn */
			"tw" => "Twi",
			"ty" => "Tahitian",
			"tyv" => "Tuvinian",
			"udm" => "Udmurt",
			"ug" => "Uighur, Uyghur",
			"uga" => "Ugaritic",
			"uk" => "Ukrainian", /* Suppress-Script - Cyrl */
			"umb" => "Umbundu",
			"und" => "Undetermined",
			"ur" => "Urdu", /* Suppress-Script - Arab */
			"uz" => "Uzbek",
			"vai" => "Vai",
			"ve" => "Venda", /* Suppress-Script - Latn */
			"vi" => "Vietnamese", /* Suppress-Script - Latn */
			"vo" => "Volapük",
			"vot" => "Votic",
			"wa" => "Walloon",
			"wak" => "Wakashan languages",
			"wal" => "Wolaytta, Wolaitta",
			"war" => "Waray",
			"was" => "Washo",
			"wen" => "Sorbian languages",
			"wo" => "Wolof", /* Suppress-Script - Latn */
			"xal" => "Kalmyk, Oirat",
			"xh" => "Xhosa", /* Suppress-Script - Latn */
			"yao" => "Yao",
			"yap" => "Yapese",
			"yi" => "Yiddish", /* Suppress-Script - Hebr */
			"yo" => "Yoruba",
			"ypk" => "Yupik languages",
			"za" => "Zhuang, Chuang",
			"zap" => "Zapotec",
			"zbl" => "Blissymbols, Blissymbolics, Bliss", /* Suppress-Script - Blis */
			"zen" => "Zenaga",
			"zh" => "Chinese",
			"znd" => "Zande languages",
			"zu" => "Zulu", /* Suppress-Script - Latn */
			"zun" => "Zuni",
			"zxx" => "No linguistic content, Not applicable",
			"zza" => "Zaza, Dimili, Dimli, Kirdki, Kirmanjki, Zazaki"),
		"script"=>array(
			"Arab" => "Arabic",
			"Armi" => "Imperial Aramaic",
			"Armn" => "Armenian",
			"Avst" => "Avestan",
			"Bali" => "Balinese",
			"Batk" => "Batak",
			"Beng" => "Bengali",
			"Blis" => "Blissymbols",
			"Bopo" => "Bopomofo",
			"Brah" => "Brahmi",
			"Brai" => "Braille",
			"Bugi" => "Buginese",
			"Buhd" => "Buhid",
			"Cakm" => "Chakma",
			"Cans" => "Unified Canadian Aboriginal Syllabics",
			"Cari" => "Carian",			"Cham" => "Cham",
			"Cher" => "Cherokee",
			"Cirt" => "Cirth",
			"Copt" => "Coptic",
			"Cprt" => "Cypriot",
			"Cyrl" => "Cyrillic",
			"Cyrs" => "Cyrillic (Old Church Slavonic variant)",
			"Deva" => "Devanagari (Nagari)",
			"Dsrt" => "Deseret (Mormon)",
			"Egyd" => "Egyptian demotic",
			"Egyh" => "Egyptian hieratic",
			"Egyp" => "Egyptian hieroglyphs",
			"Ethi" => "Ethiopic (Geʻez), Ethiopic (Ge'ez)",
			"Geok" => "Khutsuri (Asomtavruli and Nuskhuri)",
			"Geor" => "Georgian (Mkhedruli)",
			"Glag" => "Glagolitic",
			"Goth" => "Gothic",
			"Grek" => "Greek",
			"Gujr" => "Gujarati",
			"Guru" => "Gurmukhi",
			"Hang" => "Hangul (Hangŭl, Hangeul)",
			"Hani" => "Han (Hanzi, Kanji, Hanja)",
			"Hano" => "Hanunoo (Hanunóo)",
			"Hans" => "Han (Simplified variant)",
			"Hant" => "Han (Traditional variant)",
			"Hebr" => "Hebrew",
			"Hira" => "Hiragana",
			"Hmng" => "Pahawh Hmong",
			"Hrkt" => "(alias for Hiragana + Katakana)",
			"Hung" => "Old Hungarian",
			"Inds" => "Indus (Harappan)",
			"Ital" => "Old Italic (Etruscan, Oscan, etc.)",
			"Java" => "Javanese",
			"Jpan" => "Japanese (alias for Han + Hiragana + Katakana)",
			"Kali" => "Kayah Li",
			"Kana" => "Katakana",
			"Khar" => "Kharoshthi",
			"Khmr" => "Khmer",
			"Knda" => "Kannada",
			"Kore" => "Korean (alias for Hangul + Han)",
			"Kthi" => "Kaithi",
			"Lana" => "Lanna, Tai Tham",
			"Laoo" => "Lao",
			"Latf" => "Latin (Fraktur variant)",
			"Latg" => "Latin (Gaelic variant)",
			"Latn" => "Latin",
			"Lepc" => "Lepcha (Róng)",
			"Limb" => "Limbu",
			"Lina" => "Linear A",
			"Linb" => "Linear B",
			"Lyci" => "Lycian",
			"Lydi" => "Lydian",
			"Mand" => "Mandaic, Mandaean",
			"Mani" => "Manichaean",
			"Maya" => "Mayan hieroglyphs",
			"Mero" => "Meroitic",
			"Mlym" => "Malayalam",
			"Mong" => "Mongolian",
			"Moon" => "Moon, Moon code, Moon script, Moon type",
			"Mtei" => "Meitei Mayek, Meithei, Meetei",
			"Mymr" => "Myanmar (Burmese)",
			"Nkoo" => "N’Ko",
			"Ogam" => "Ogham",
			"Olck" => "Ol Chiki (Ol Cemet', Ol, Santali)",
			"Orkh" => "Orkhon",
			"Orya" => "Oriya",
			"Osma" => "Osmanya",
			"Perm" => "Old Permic",
			"Phag" => "Phags-pa",
			"Phli" => "Inscriptional Pahlavi",
			"Phlp" => "Psalter Pahlavi",
			"Phlv" => "Book Pahlavi",
			"Phnx" => "Phoenician",
			"Plrd" => "Pollard Phonetic",
			"Prti" => "Inscriptional Parthian",
			/**
			 * "Qaaa" to "Qabx" are reserved for PRIVATE USE
			*/		
			"Rjng" => "Rejang, Redjang, Kaganga",
			"Roro" => "Rongorongo",
			"Runr" => "Runic",
			"Samr" => "Samaritan",
			"Sara" => "Sarati",
			"Saur" => "Saurashtra",
			"Sgnw" => "SignWriting",
			"Shaw" => "Shavian (Shaw)",
			"Sinh" => "Sinhala",
			"Sund" => "Sundanese",
			"Sylo" => "Syloti Nagri",
			"Syrc" => "Syriac",
			"Syre" => "Syriac (Estrangelo variant)",
			"Syrj" => "Syriac (Western variant)",
			"Syrn" => "Syriac (Eastern variant)",
			"Tagb" => "Tagbanwa",
			"Tale" => "Tai Le",
			"Talu" => "New Tai Lue",
			"Taml" => "Tamil",
			"Tavt" => "Tai Viet",
			"Telu" => "Telugu",
			"Teng" => "Tengwar",
			"Tfng" => "Tifinagh (Berber)",
			"Tglg" => "Tagalog",
			"Thaa" => "Thaana",
			"Thai" => "Thai",
			"Tibt" => "Tibetan",
			"Ugar" => "Ugaritic",
			"Vaii" => "Vai",
			"Visp" => "Visible Speech",
			"Xpeo" => "Old Persian",
			"Xsux" => "Cuneiform, Sumero-Akkadian",
			"Yiii" => "Yi",
			"Zmth" => "Mathematical notation",
			"Zsym" => "Symbols",
			"Zxxx" => "Code for unwritten documents",
			"Zyyy" => "Code for undetermined script",
			"Zzzz" => "Code for uncoded script"),
		"region"=>array(
		 	/**
		 	 * "AA" is reserved for PRIVATE USE
		 	 */
			"AD" => "Andorra",	
			"AE" => "United Arab Emirates",	
			"AF" => "Afghanistan",	
			"AG" => "Antigua and Barbuda",	
			"AI" => "Anguilla",	
			"AL" => "Albania",	
			"AM" => "Armenia",	
			"AN" => "Netherlands Antilles",	
			"AO" => "Angola",	
			"AQ" => "Antarctica",	
			"AR" => "Argentina",	
			"AS" => "American Samoa",	
			"AT" => "Austria",	
			"AU" => "Australia",	
			"AW" => "Aruba",	
			"AX" => "Åland Islands",	
			"AZ" => "Azerbaijan",	
			"BA" => "Bosnia and Herzegovina",	
			"BB" => "Barbados",	
			"BD" => "Bangladesh",	
			"BE" => "Belgium",	
			"BF" => "Burkina Faso",	
			"BG" => "Bulgaria",	
			"BH" => "Bahrain",	
			"BI" => "Burundi",	
			"BJ" => "Benin",	
			"BL" => "Saint Barthélemy",	
			"BM" => "Bermuda",	
			"BN" => "Brunei Darussalam",	
			"BO" => "Bolivia",	
			"BR" => "Brazil",	
			"BS" => "Bahamas",	
			"BT" => "Bhutan",	
			"BU" => "Burma [Do not use!]", /* Preferred-Value - MM *//* Deprecated - 1989-12-05 */
			"BV" => "Bouvet Island",	
			"BW" => "Botswana",	
			"BY" => "Belarus",	
			"BZ" => "Belize",	
			"CA" => "Canada",	
			"CC" => "Cocos (Keeling) Islands",	
			"CD" => "Congo, The Democratic Republic of the",	
			"CF" => "Central African Republic",	
			"CG" => "Congo",	
			"CH" => "Switzerland",	
			"CI" => "Côte d'Ivoire",	
			"CK" => "Cook Islands",	
			"CL" => "Chile",	
			"CM" => "Cameroon",	
			"CN" => "China",	
			"CO" => "Colombia",	
			"CR" => "Costa Rica",	
			"CS" => "Serbia and Montenegro [Do not use!]", /* Deprecated - 2006-10-05 *//* Comments - see RS for Serbia or ME for Montenegro */
			"CU" => "Cuba",	
			"CV" => "Cape Verde",	
			"CX" => "Christmas Island",	
			"CY" => "Cyprus",	
			"CZ" => "Czech Republic",	
			"DD" => "German Democratic Republic [Do not use!]", /* Preferred-Value - DE *//* Deprecated - 1990-10-30 */
			"DE" => "Germany",	
			"DJ" => "Djibouti",	
			"DK" => "Denmark",	
			"DM" => "Dominica",	
			"DO" => "Dominican Republic",	
			"DZ" => "Algeria",	
			"EC" => "Ecuador",	
			"EE" => "Estonia",	
			"EG" => "Egypt",	
			"EH" => "Western Sahara",	
			"ER" => "Eritrea",	
			"ES" => "Spain",	
			"ET" => "Ethiopia",	
			"FI" => "Finland",	
			"FJ" => "Fiji",	
			"FK" => "Falkland Islands (Malvinas)",	
			"FM" => "Micronesia, Federated States of",	
			"FO" => "Faroe Islands",	
			"FR" => "France",	
			"FX" => "Metropolitan France [Do not use!]", /* Preferred-Value - FR *//* Deprecated - 1997-07-14 */
			"GA" => "Gabon",	
			"GB" => "United Kingdom", /* Comments - as of 2006-03-29 GB no longer includes the Channel Islands and Isle of Man; see GG, JE, IM  */
			"GD" => "Grenada",	
			"GE" => "Georgia",	
			"GF" => "French Guiana",	
			"GG" => "Guernsey",	
			"GH" => "Ghana",	
			"GI" => "Gibraltar",	
			"GL" => "Greenland",	
			"GM" => "Gambia",	
			"GN" => "Guinea",	
			"GP" => "Guadeloupe",	
			"GQ" => "Equatorial Guinea",	
			"GR" => "Greece",	
			"GS" => "South Georgia and the South Sandwich Islands",	
			"GT" => "Guatemala",	
			"GU" => "Guam",	
			"GW" => "Guinea-Bissau",	
			"GY" => "Guyana",	
			"HK" => "Hong Kong",	
			"HM" => "Heard Island and McDonald Islands",	
			"HN" => "Honduras",	
			"HR" => "Croatia",	
			"HT" => "Haiti",	
			"HU" => "Hungary",	
			"ID" => "Indonesia",	
			"IE" => "Ireland",	
			"IL" => "Israel",	
			"IM" => "Isle of Man",	
			"IN" => "India",	
			"IO" => "British Indian Ocean Territory",	
			"IQ" => "Iraq",	
			"IR" => "Iran, Islamic Republic of",	
			"IS" => "Iceland",	
			"IT" => "Italy",	
			"JE" => "Jersey",
			"JM" => "Jamaica",	
			"JO" => "Jordan",	
			"JP" => "Japan",	
			"KE" => "Kenya",	
			"KG" => "Kyrgyzstan",	
			"KH" => "Cambodia",	
			"KI" => "Kiribati",	
			"KM" => "Comoros",	
			"KN" => "Saint Kitts and Nevis",	
			"KP" => "Korea, Democratic People's Republic of",	
			"KR" => "Korea, Republic of",	
			"KW" => "Kuwait",	
			"KY" => "Cayman Islands",	
			"KZ" => "Kazakhstan",	
			"LA" => "Lao People's Democratic Republic",	
			"LB" => "Lebanon",	
			"LC" => "Saint Lucia",	
			"LI" => "Liechtenstein",	
			"LK" => "Sri Lanka",	
			"LR" => "Liberia",	
			"LS" => "Lesotho",	
			"LT" => "Lithuania",	
			"LU" => "Luxembourg",	
			"LV" => "Latvia",	
			"LY" => "Libyan Arab Jamahiriya",	
			"MA" => "Morocco",	
			"MC" => "Monaco",	
			"MD" => "Moldova",	
			"ME" => "Montenegro",
			"MF" => "Saint Martin",	
			"MG" => "Madagascar",	
			"MH" => "Marshall Islands",	
			"MK" => "Macedonia, The Former Yugoslav Republic of",	
			"ML" => "Mali",	
			"MM" => "Myanmar",	
			"MN" => "Mongolia",	
			"MO" => "Macao",	
			"MP" => "Northern Mariana Islands",	
			"MQ" => "Martinique",	
			"MR" => "Mauritania",	
			"MS" => "Montserrat",	
			"MT" => "Malta",	
			"MU" => "Mauritius",	
			"MV" => "Maldives",	
			"MW" => "Malawi",	
			"MX" => "Mexico",	
			"MY" => "Malaysia",	
			"MZ" => "Mozambique",	
			"NA" => "Namibia",	
			"NC" => "New Caledonia",	
			"NE" => "Niger",	
			"NF" => "Norfolk Island",	
			"NG" => "Nigeria",	
			"NI" => "Nicaragua",	
			"NL" => "Netherlands",	
			"NO" => "Norway",	
			"NP" => "Nepal",	
			"NR" => "Nauru",	
			"NT" => "Neutral Zone [Do not use!]", /* Deprecated - 1993-07-12 */
			"NU" => "Niue",	
			"NZ" => "New Zealand",	
			"OM" => "Oman",	
			"PA" => "Panama",	
			"PE" => "Peru",	
			"PF" => "French Polynesia",	
			"PG" => "Papua New Guinea",	
			"PH" => "Philippines",	
			"PK" => "Pakistan",	
			"PL" => "Poland",	
			"PM" => "Saint Pierre and Miquelon",	
			"PN" => "Pitcairn",	
			"PR" => "Puerto Rico",	
			"PS" => "Palestinian Territory, Occupied",	
			"PT" => "Portugal",	
			"PW" => "Palau",	
			"PY" => "Paraguay",	
			"QA" => "Qatar",
		 	/**
		 	 * "QM" to "QZ" are reserved for PRIVATE USE
		 	 */			
			"RE" => "Réunion",	
			"RO" => "Romania",	
			"RS" => "Serbia",	
			"RU" => "Russian Federation",	
			"RW" => "Rwanda",	
			"SA" => "Saudi Arabia",	
			"SB" => "Solomon Islands",	
			"SC" => "Seychelles",	
			"SD" => "Sudan",	
			"SE" => "Sweden",	
			"SG" => "Singapore",	
			"SH" => "Saint Helena",	
			"SI" => "Slovenia",	
			"SJ" => "Svalbard and Jan Mayen",	
			"SK" => "Slovakia",	
			"SL" => "Sierra Leone",	
			"SM" => "San Marino",	
			"SN" => "Senegal",	
			"SO" => "Somalia",	
			"SR" => "Suriname",	
			"ST" => "Sao Tome and Principe",	
			"SU" => "Union of Soviet Socialist Republics [Do not use!]", /* Deprecated - 1992-08-30 */
			"SV" => "El Salvador",	
			"SY" => "Syrian Arab Republic",	
			"SZ" => "Swaziland",	
			"TC" => "Turks and Caicos Islands",	
			"TD" => "Chad",	
			"TF" => "French Southern Territories",	
			"TG" => "Togo",	
			"TH" => "Thailand",	
			"TJ" => "Tajikistan",	
			"TK" => "Tokelau",	
			"TL" => "Timor-Leste",	
			"TM" => "Turkmenistan",	
			"TN" => "Tunisia",	
			"TO" => "Tonga",	
			"TP" => "East Timor [Do not use!]", /* Preferred-Value - TL *//* Deprecated - 2002-11-15 */
			"TR" => "Turkey",	
			"TT" => "Trinidad and Tobago",	
			"TV" => "Tuvalu",	
			"TW" => "Taiwan, Province of China",	
			"TZ" => "Tanzania, United Republic of",	
			"UA" => "Ukraine",	
			"UG" => "Uganda",	
			"UM" => "United States Minor Outlying Islands",	
			"US" => "United States",	
			"UY" => "Uruguay",	
			"UZ" => "Uzbekistan",	
			"VA" => "Holy See (Vatican City State)",	
			"VC" => "Saint Vincent and the Grenadines",	
			"VE" => "Venezuela",	
			"VG" => "Virgin Islands, British",	
			"VI" => "Virgin Islands, U.S.",	
			"VN" => "Viet Nam",	
			"VU" => "Vanuatu",	
			"WF" => "Wallis and Futuna",	
			"WS" => "Samoa",	
		 	/**
		 	 * "XA" to "XZ" are reserved for PRIVATE USE
		 	 */		
			"YD" => "Yemen, Democratic [Do not use!]", /* Preferred-Value - YE *//* Deprecated - 1990-08-14 */
			"YE" => "Yemen",	
			"YT" => "Mayotte",	
			"YU" => "Yugoslavia [Do not use!]", /* Preferred-Value - CS *//* Deprecated - 2003-07-23 */
			"ZA" => "South Africa",	
			"ZM" => "Zambia",	
			"ZR" => "Zaire [Do not use!]", /* Preferred-Value - CD *//* Deprecated - 1997-07-14 */
			"ZW" => "Zimbabwe",	
		 	/**
		 	 * "ZZ" is reserved for PRIVATE USE
		 	 */		
			"001" => "World",	
			"002" => "Africa",	
			"005" => "South America",	
			"009" => "Oceania",	
			"011" => "Western Africa",	
			"013" => "Central America",	
			"014" => "Eastern Africa",	
			"015" => "Northern Africa",	
			"017" => "Middle Africa",	
			"018" => "Southern Africa",	
			"019" => "Americas",	
			"021" => "Northern America",	
			"029" => "Caribbean",	
			"030" => "Eastern Asia",	
			"034" => "Southern Asia",	
			"035" => "South-Eastern Asia",	
			"039" => "Southern Europe",	
			"053" => "Australia and New Zealand",	
			"054" => "Melanesia",	
			"057" => "Micronesia",	
			"061" => "Polynesia",	
			"142" => "Asia",	
			"143" => "Central Asia",	
			"145" => "Western Asia",	
			"150" => "Europe",	
			"151" => "Eastern Europe",	
			"154" => "Northern Europe",	
			"155" => "Western Europe",	
			"419" => "Latin America and the Caribbean"),
		"variant"=>array(
			"1606nict" => "Late Middle French (to 1606)", /* Prefix - frm *//* Comments - 16th century French as in Jean Nicot, "Thresor de la langue */
			"1694acad" => "Early Modern French", /* Prefix - fr *//* Comments - 17th century French, as catalogued in the "Dictionnaire de */
			"1901" => "Traditional German orthography", /* Prefix - de */
			"1959acad" => "\"Academic\" (\"governmental\") variant of Belarusian as", /* Prefix - be */
			"1994" => "Standardized Resian orthography", /* Prefix - sl-rozaj, sl-rozaj-biske, sl-rozaj-njiva, sl-rozaj-osojs, sl-rozaj-solba *//* Comments - For standardized Resian an orthography was published in 1994. */
			"1996" => "German orthography of 1996", /* Prefix - de */
			"arevela" => "Eastern Armenian", /* Prefix - hy */
			"arevmda" => "Western Armenian", /* Prefix - hy */
			"baku1926" => "Unified Turkic Latin Alphabet (Historical)", /* Prefix - az, ba, crh, kk, krc, ky, sah, tk, tt, uz *//* Comments - Denotes alphabet used in Turkic republics/regions of the *//*   represent equivalent phonemes in a unified fashion. Also known as - New */
			"biske" => "The San Giorgio dialect of Resian, The Bila dialect of Resian", /* Prefix - sl-rozaj *//* Comments - The dialect of San Giorgio/Bila is one of the four major local */
			"boont" => "Boontling", /* Prefix - en *//* Comments - Jargon embedded in American English */
			"fonipa" => "International Phonetic Alphabet",
			"fonupa" => "Uralic Phonetic Alphabet",
			"kkcor" => "Common Cornish orthography of Revived Cornish", /* Prefix - kw */
			"lipaw" => "The Lipovaz dialect of Resian, The Lipovec dialect of Resian", /* Prefix - sl-rozaj *//* Comments - The dialect of Lipovaz/Lipovec is one of the minor local */
			"monoton" => "Monotonic Greek", /* Prefix - el */
			"nedis" => "Natisone dialect, Nadiza dialect", /* Prefix - sl */
			"njiva" => "The Gniva dialect of Resian, The Njiva dialect of Resian", /* Prefix - sl-rozaj *//* Comments - The dialect of Gniva/Njiva is one of the four major local */
			"osojs" => "The Oseacco dialect of Resian, The Osojane dialect of Resian", /* Prefix - sl-rozaj *//* Comments - The dialect of Oseacco/Osojane is one of the four major local */
			"pinyin" => "Pinyin romanization", /* Prefix - zh-Latn, bo-Latn */
			"polyton" => "Polytonic Greek", /* Prefix - el */
			"rozaj" => "Resian, Resianic, Rezijan", /* Prefix - sl */
			"scotland" => "Scottish Standard English", /* Prefix - en */
			"scouse" => "Scouse", /* Prefix - en *//* Comments - English Liverpudlian dialect known as 'Scouse' */
			"solba" => "The Stolvizza dialect of Resian, The Solbica dialect of Resian", /* Prefix - sl-rozaj *//* Comments - The dialect of Stolvizza/Solbica is one of the four major */
			"tarask" => "Belarusian in Taraskievica orthography", /* Prefix - be *//* Comments - The subtag represents Branislau Taraskievic's Belarusian */
			"uccor" => "Unified Cornish orthography of Revived Cornish", /* Prefix - kw */
			"ucrcor" => "Unified Cornish Revised orthography of Revived Cornish", /* Prefix - kw */
			"valencia" => "Valencian", /* Prefix - ca *//* Comments - Variety spoken in the "Comunidad Valenciana" region of Spain, */
			"wadegile" => "Wade-Giles romanization" /* Prefix - zh-Latn */),
		"grandfathered"=>array(
			"art-lojban" => "Lojban [Do not use!]",	/* Preferred-Value - jbo *//* Deprecated - 2003-09-02 *//* Comments - replaced by ISO code jbo */
			"cel-gaulish" => "Gaulish",	
			"en-GB-oed" => "English, Oxford English Dictionary spelling",	
			"i-ami" => "Amis",	
			"i-bnn" => "Bunun",	
			"i-default" => "Default Language",	
			"i-enochian" => "Enochian",	
			"i-hak" => "Hakka [Do not use!]",	/* Preferred-Value - zh-hakka *//* Deprecated - 2000-01-10 */
			"i-klingon" => "Klingon [Do not use!]",	/* Preferred-Value - tlh *//* Deprecated - 2004-02-24 *//* Comments - replaced by ISO code tlh */
			"i-lux" => "Luxembourgish [Do not use!]",	/* Preferred-Value - lb *//* Deprecated - 1998-09-09 *//* Comments - replaced by ISO code lb */
			"i-mingo" => "Mingo",	
			"i-navajo" => "Navajo [Do not use!]",	/* Preferred-Value - nv *//* Deprecated - 2000-02-18 *//* Comments - replaced by ISO code nv */
			"i-pwn" => "Paiwan",	
			"i-tao" => "Tao",	
			"i-tay" => "Tayal",	
			"i-tsu" => "Tsou",	
			"no-bok" => "Norwegian Bokmal [Do not use!]",	/* Preferred-Value - nb *//* Deprecated - 2000-02-18 *//* Comments - replaced by ISO code nb */
			"no-nyn" => "Norwegian Nynorsk [Do not use!]",	/* Preferred-Value - nn *//* Deprecated - 2000-02-18 *//* Comments - replaced by ISO code nn */
			"sgn-BE-fr" => "Belgian-French Sign Language",	
			"sgn-BE-nl" => "Belgian-Flemish Sign Language",	
			"sgn-CH-de" => "Swiss German Sign Language",	
			"zh-cmn" => "Mandarin Chinese",	
			"zh-cmn-Hans" => "Mandarin Chinese (Simplified)",	
			"zh-cmn-Hant" => "Mandarin Chinese (Traditional)",	
			"zh-gan" => "Kan or Gan",	
			"zh-guoyu" => "Mandarin or Standard Chinese [Do not use!]",	/* Preferred-Value - zh-cmn *//* Deprecated - 2005-07-15 */
			"zh-hakka" => "Hakka",	
			"zh-min" => "Min, Fuzhou, Hokkien, Amoy, or Taiwanese",	
			"zh-min-nan" => "Minnan, Hokkien, Amoy, Taiwanese, Southern Min, Southern",	
			"zh-wuu" => "Shanghaiese or Wu",	
			"zh-xiang" => "Xiang or Hunanese",	
			"zh-yue" => "Cantonese"),
		"redundant"=>array(
			"az-Arab" => "Azerbaijani in Arabic script", 
			"az-Cyrl" => "Azerbaijani in Cyrillic script", 
			"az-Latn" => "Azerbaijani in Latin script", 
			"be-Latn" => "Belarusian in Latin script", 
			"bs-Cyrl" => "Bosnian in Cyrillic script", 
			"bs-Latn" => "Bosnian in Latin script", 
			"de-1901" => "German, traditional orthography", 
			"de-1996" => "German, orthography of 1996", 
			"de-AT-1901" => "German, Austrian variant, traditional orthography", 
			"de-AT-1996" => "German, Austrian variant, orthography of 1996", 
			"de-CH-1901" => "German, Swiss variant, traditional orthography", 
			"de-CH-1996" => "German, Swiss variant, orthography of 1996", 
			"de-DE-1901" => "German, German variant, traditional orthography", 
			"de-DE-1996" => "German, German variant, orthography of 1996", 
			"en-boont" => "Boontling", 
			"en-scouse" => "Scouse", 
			"es-419" => "Latin American Spanish", 
			"iu-Cans" => "Inuktitut in Canadian Aboriginal Syllabic script", 
			"iu-Latn" => "Inuktitut in Latin script", 
			"mn-Cyrl" => "Mongolian in Cyrillic script", 
			"mn-Mong" => "Mongolian in Mongolian script", 
			"sgn-BR" => "Brazilian Sign Language", 
			"sgn-CO" => "Colombian Sign Language", 
			"sgn-DE" => "German Sign Language", 
			"sgn-DK" => "Danish Sign Language", 
			"sgn-ES" => "Spanish Sign Language", 
			"sgn-FR" => "French Sign Language", 
			"sgn-GB" => "British Sign Language", 
			"sgn-GR" => "Greek Sign Language", 
			"sgn-IE" => "Irish Sign Language", 
			"sgn-IT" => "Italian Sign Language", 
			"sgn-JP" => "Japanese Sign Language", 
			"sgn-MX" => "Mexican Sign Language", 
			"sgn-NI" => "Nicaraguan Sign Language", 
			"sgn-NL" => "Dutch Sign Language", 
			"sgn-NO" => "Norwegian Sign Language", 
			"sgn-PT" => "Portuguese Sign Language", 
			"sgn-SE" => "Swedish Sign Language", 
			"sgn-US" => "American Sign Language", 
			"sgn-ZA" => "South African Sign Language", 
			"sl-nedis" => "Natisone dialect, Nadiza dialect", 
			"sl-rozaj" => "Resian, Resianic, Rezijan", 
			"sr-Cyrl" => "Serbian in Cyrillic script", 
			"sr-Latn" => "Serbian in Latin script", 
			"tg-Arab" => "Tajik in Arabic script", 
			"tg-Cyrl" => "Tajik in Cyrillic script", 
			"uz-Cyrl" => "Uzbek in Cyrillic script", 
			"uz-Latn" => "Uzbek in Latin script", 
			"yi-latn" => "Yiddish, in Latin script", 
			"zh-Hans" => "simplified Chinese", 
			"zh-Hans-CN" => "PRC Mainland Chinese in simplified script", 
			"zh-Hans-HK" => "Hong Kong Chinese in simplified script", 
			"zh-Hans-MO" => "Macao Chinese in simplified script", 
			"zh-Hans-SG" => "Singapore Chinese in simplified script", 
			"zh-Hans-TW" => "Taiwan Chinese in simplified script", 
			"zh-Hant" => "traditional Chinese", 
			"zh-Hant-CN" => "PRC Mainland Chinese in traditional script", 
			"zh-Hant-HK" => "Hong Kong Chinese in traditional script", 
			"zh-Hant-MO" => "Macao Chinese in traditional script", 
			"zh-Hant-SG" => "Singapore Chinese in traditional script", 
			"zh-Hant-TW" => "Taiwan Chinese in traditional script")	
	);	
				
	/**
	 * Allowed variants based on prefixes, for validation purposes
	 *
	 * @var array
	 * @access public
	 **/	
	public static $variantsByPrefix = array (
		"az" => array("baku1926"),
		"ba" => array("baku1926"),
		"be" => array("1959acad","tarask"),
		"bo-Latn" => array ("pinyin"),
		"ca" => array("Valencia"),
		"crh" => array("baku1926"),
		"de" => array("1901","1996"),
		"el" => array("monoton","polyton"),
		"en" => array("boont","scotland","scouse"),
		"fr" => array("1694acad"),
		"frm" => array("1606nict"),
		"hy" => array("arevela","arevmda"),
		"kk" => array("baku1926"),
		"krc" => array("baku1926"),
		"kw" => array("kkcor", "uccor", "ucrcor"),
		"ky" => array("baku1926"),
		"sah" => array("baku1926"),
		"sl" => array("nedis"),
		"sl-rozaj" => array("1994","biske","lipaw","njiva","osojs","solba"),
		"sl-rozaj-biske" => array("1994"),
		"sl-rozaj-njiva" => array("1994"),
		"sl-rozaj-osojs" => array("1994"),
		"sl-rozaj-solba" => array("1994"),
		"tk" => array("baku1926"),
		"tt" => array("baku1926"),
		"uz" => array("baku1926"),
		"zh-Latn" => array("pinyin","wadegile")
	);

	/**
	 * Returns the corresponding value of the catalog
	 *
	 * @param string $subtagType
	 * @param string $subtag
	 * @param string $caseSensitive
	 * @return string
	 */
	public static function queryCatalog($subtagType,$subtag,$caseSensitive=false) {
		//There's no point in being case sensitive strict with the subtag type:
		$subtagType=strtolower($subtagType);
		
		if ($caseSensitive) {
			return self::$fullCatalog[$subtagType][$subtag];
		} else {
			$caseInsensitiveArray= array_change_key_case(self::$fullCatalog[$subtagType],CASE_LOWER);
			return $caseInsensitiveArray[strtolower($subtag)];			
		}
	}
	
	/**
	 * Searches the full catalog for a subtag, regardless of its type
	 * 
	 * IMPORTANT: Some keys are the same in different subtag types (languages
	 * and regions), but with different capitalization. If you use a case
	 * insensitive search, you will only get the first subtag type.
	 * 
	 * Returns false if the key is not found
	 *
	 * @param string $subtag
	 * @param boolean $caseSensitive
	 * @return string
	 */	
	public static function queryFullCatalog($subtag,$caseSensitive=false) {
		foreach (array_keys(self::$fullCatalog) as $subtagType) {
			$value = self::queryCatalog($subtagType,$subtag,$caseSensitive);
			if ($value) { 
				return $value;
			}
		}
		return false;
	}		
	
	/**
	 * Returns the corresponding value of a subtag, regardless of the type
	 * 
	 * Returns false if the key is not found
	 * 
	 * IMPORTANT: Some keys are the same in different subtag types (languages
	 * and regions), but with different capitalization. If you use a case
	 * insensitive search, you will only get the first subtag type.
	 *
	 * @param string $subtag
	 * @param boolean $caseSensitive
	 * @return string
	 */	
	public static function getSubtagType($subtag,$caseSensitive=true) {
		foreach (array_keys(self::$fullCatalog) as $subtagType) {
			$searchedArray = self::$fullCatalog[$subtagType];
			if (!$caseSensitive) {
				$subtag=strtolower($subtag);
				array_change_key_case($searchedArray,CASE_LOWER);
			}
			if (array_key_exists($subtag,$searchedArray)) { 
				return $subtagType;
			}
		}
		return false;
	}
	
	/**
	 * Converts a locale string to the corresponding IANA representation
	 * 
	 * By default, $strict is set to false, so unmatched codes will be left as-is,
	 * otherwise will return false.
	 *
	 * @param string $locale
	 * @param boolean $caseSensitive
	 * @return string
	 */
	public static function convertLocale ($locale, $caseSensitive=false) {
		/* 
		* Locale format is as follows:
		* language-script-region-variant-extension-privateuse
		*/
		
		//Some formatting to avoid errors:
		$localeDelimiters=array("_",".","@");
		$locale=str_replace($localeDelimiters,"-",$locale);
		
		$sections=explode("-",$locale);		
		$available_types=array_keys(self::$fullCatalog);
		
		$description="";
		
		foreach ($sections as $section) {
			foreach ($available_types as $pos=>$type) {
				$desc=self::queryCatalog($type, $section, $caseSensitive);
				if ($desc) {
					unset($available_types[$pos]);
					break;
				} else {
					$desc=$section;
				}
			}
			$description.=self::subtagFormatting($desc,$type);
		}
		
		return $description;
	}
	
	/**
	 * Returns simple code formatting depending on the subtag type
	 * 
	 *
	 * @param string $description
	 * @param string $subtagType
	 * @return string
	 */	
	private static function subtagFormatting($description, $subtagType) {
		$formatted="";
		
		switch ($subtagType) {
		    case "language":
		        $formatted=$description;
		        break;
		    case "script":
		        $formatted=", ".$description." script";
		        break;
		    case "region":
		        $formatted=", as used in ".$description;
		        break;
		    case "variant":
		        $formatted=", ".$description." variant";
		        break;		        
		    default:
		    	$formatted="-".$description;
		}
		
		return $formatted;
	}
}
?>
